import axios from "axios";
import { nanoid } from "nanoid";
import { reactive } from "vue";

export default function(){
    let TalkArray=reactive([
        {
            id: "01",
            content: "数组开头"
        }
    ])
     async function GetTalk(){
         let x=await axios.get('http://api.uomg.com/api/rand.qinghua?format=json');
        let obj={id:nanoid(),content: x.data.content};
        TalkArray.push(obj);
    }
    return {TalkArray,GetTalk};
}